package com.telit.firecommand.enums;

/**
 * Create by Chencf 2022/09/15
 * 上报枚举类
 */
public enum FireDjType {

    ONE("极高","五级"),
    TWO("高","四级"),
    THREE("较高","三级"),
    FOUR("中","二级"),
    FIVE("低","一级");





    private String code;
    private String str;

    FireDjType(String code, String str) {
        this.code = code;
        this.str = str;
    }

    public String getCode() {
        return code;
    }

    public String getStr() {
        return str;
    }

    /**
     * 根据code  获取对应的str描述字符串
     */
    public static String code2Str(String code) {
        if (code==null)
            return null;
        for (FireDjType statusNum : FireDjType.values()) {
            if (statusNum.getCode().equals(code)) {
                return statusNum.getStr();
            }
        }
        return null;
    }

}
